#!/bin/sh

mv *svg usr/share/pixmaps
find usr/share/applications -iname '*seamonkey.desktop' | \
xargs sed -i -e 's, %.$,,g' \
             -e 's/^Categories.*/Categories=X-Internet-browser/' \
             -e 's/^Icon.*/Icon=seamonkey.svg/'

SM=`find usr/${PLIB} -maxdepth 1 -type d -name 'seamonkey*'`
mkdir -p ${SM}/defaults/pref
PREFDIR="${SM}/defaults/pref"

cat > ${PREFDIR}/local-settings.js <<_EOF
//
//default home page
pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=file:///usr/share/doc/home.htm");
_EOF

(cd ${SM}
[ -f omni.ja ] && mkdir omnidir
mv omni.ja omnidir/omni.zip
cd omnidir
unzip omni.zip
rm omni.zip
zip -0 -y -R ../newomni '*'
cd ..
mv newomni.zip omni.ja
rm -r omnidir)

#mail
sed -i -e 's/^Categories.*/Categories=Email;/' \
       -e 's/^Icon.*/Icon=seamonkey-mail.svg/' \
       usr/share/applications/seamonkey-mail.desktop
#composer
cat > usr/share/applications/seamonkey-composer.desktop <<_EOG
[Desktop Entry]
Encoding=UTF-8
Name=SeaMonkey HTML Editor
Comment=HTML Editor
Exec=/usr/bin/seamonkey -edit
Terminal=0
Type=Application
Icon=seamonkey-composer.svg
Categories=WebDevelopment;
_EOG
#dev goes to null anyway
rm -r usr/include
rm -r usr/${PLIB}/pkgconfig
